package comand.impl;

import comand.Calcultor;
import comand.Command;

public class Sub extends Command {
    Double total, value;

    public Sub(Double value) {
        this.total = Calcultor.total;
        this.value = value;
    }

    @Override
    public void execute() {
        System.out.println(total+"-"+value+"="+(total-value));
        total = total - value;
        Calcultor.total=this.total;
    }

    @Override
    public void deExecute() {
        System.out.println(total+"+"+value+"="+(total+value));
        total = total + value;
        Calcultor.total=this.total;
    }
}
